/**
 * 
 */
package com.java.test.paymanage.dto;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.LocalDateTime;
import java.time.ZoneOffset;

import org.springframework.jdbc.core.RowMapper;

/**
 * @author 支付渠道
 *
 */
public class PayChannelInfo implements RowMapper<PayChannelInfo> {

	// 主键id
	private int id;

	// 渠道名称
	private String channelName;

	// 支付类型id
	private int payType;

	// 支付类型名称
	private String payTypeName;

	// 添加人
	private String addPeopleName;

	// 添加时间
	private LocalDateTime addTime;

	// 备注
	private String content;
	
	// 图标
	private String iconUrl;
	
	private int sort=0;
	
	// 官方域名
	private String gfrealmname;
	

	public int getSort() {
		return sort;
	}

	public void setSort(int sort) {
		this.sort = sort;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getChannelName() {
		return channelName;
	}

	public void setChannelName(String channelName) {
		this.channelName = channelName;
	}

	public int getPayType() {
		return payType;
	}

	public void setPayType(int payType) {
		this.payType = payType;
	}

	public String getPayTypeName() {
		return payTypeName;
	}

	public void setPayTypeName(String payTypeName) {
		this.payTypeName = payTypeName;
	}

	public String getAddPeopleName() {
		return addPeopleName;
	}

	public void setAddPeopleName(String addPeopleName) {
		this.addPeopleName = addPeopleName;
	}

	public LocalDateTime getAddTime() {
		return addTime;
	}

	public void setAddTime(LocalDateTime addTime) {
		this.addTime = addTime;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	
	
	public String getIconUrl() {
		return iconUrl;
	}

	public void setIconUrl(String iconUrl) {
		this.iconUrl = iconUrl;
	}
	
	
	

	public String getGfrealmname() {
		return gfrealmname;
	}

	public void setGfrealmname(String gfrealmname) {
		this.gfrealmname = gfrealmname;
	}

	@Override
	public PayChannelInfo mapRow(ResultSet rs, int rowNum) throws SQLException {

		PayChannelInfo info = new PayChannelInfo();

		info.setId(rs.getInt("id"));
		info.setPayType(rs.getInt("pay_type"));
		info.setPayTypeName(rs.getString("pay_type_name"));
		info.setChannelName(rs.getString("channel_name"));
		info.setAddPeopleName(rs.getString("add_people_name"));
		info.setAddTime(rs.getTimestamp("add_time") == null ? null
				: rs.getTimestamp("add_time").toInstant().atZone(ZoneOffset.ofHours(8)).toLocalDateTime());
		info.setContent(rs.getString("content"));
		info.setIconUrl(rs.getString("iconUrl"));
		info.setSort(rs.getInt("sort"));
		
		info.setGfrealmname(rs.getString("gfreal_name"));
		
		
		return info;
	}

}
